import request from '../utils/request';

export async function getCourseList() {
  return request('/wyApi/api/lesson');
}

export async function getMyCourseList() {
  return request('/wyApi/api/lesson/mine');
}

export async function getCourseDetail(id) {
  return request(`/wyApi/api/lesson/${id}`);
}

export async function buy(id, payload) {
  return request(`/wyApi/api/lesson/${id}/buy`, {method: 'POST', body: payload})
}

export async function getVideoUrl(id) {
  return request(`/wyApi/api/course-video/${id}/url`)
}